<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <title>我的收藏 - <Zml:title /></title>
    <meta name="keywords" content="<Zml:keywords />"/>
    <meta name="description" content="<Zml:description />"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="__PUBLIC__/css/pintuer.css">
    <script src="__PUBLIC__/js/jquery-1.8.3.min.js"></script>
    <script src="__PUBLIC__/js/pintuer.js"></script>
    <script src="__PUBLIC__/js/respond.js"></script>
    <script src="__PUBLIC__/js/goTop.js"></script>
    <script src="__PUBLIC__/js/TouchSlide.1.1.source.js"></script>
    <!-- <script src="__PUBLIC__/lib/layer_m/layer.m.js"></script>-->
    <script src="__PUBLIC__/lib/layer/layer.js"></script>
</head>
<body class="x12 bg">
    <div class="bg-red text-white padding text-center">
        <span class="win-back icon-mail-reply float-left"></span>
        我的收藏
    </div>
    <div class="margin-top">
        <zmllist name="collect" id="zml">
    		<div class="x12 bg-white padding-top padding-bottom border-bottom">
    			<span class="x3"><img src="{$zml.cover_img|cut_image=160,60}" class="img-responsive" alt="{$zml.item_name}"></span>
    			<span class="x6 padding-small text-small"><a href="{:U('Home/Item/info',array('id'=>$zml['id']))}" >{$zml.item_name}</a></span>
    			<span class="x3">
    				<button class="button button-small bg-yellow radius-none text-small" onClick="collect('{$zml.id}','{$zml.item_name}')">取消收藏</button>
    			</span>
    		</div>
        </zmllist>
    </div>
    <div class="x12 text-center padding"><ul class="pagination border-red pagination-small">{$page}</ul></div>
	<include file="Public:foot" />
</body>
<script>
    function collect(id,itemname){
        layer.confirm('您是否要取消《'+itemname+'》的收藏', {
            btn: ['是','否'] //按钮
        }, function(){
            $.post("__MODULE__/Investor/collect_del", {
                id: id,
            },function(d){
                if (d.status == 1) {
                    layer.open({
                        content: d.info,
                        yes: function(index){
                            layer.close(index); //一般设定yes回调，必须进行手工关闭
                            layer.closeAll('page');
                            window.location.reload()
                        }
                    });  
                }else{
                    layer.open({ content: d.info,});
                }
            });
        }, function(){
            layer.msg('您选择了取消', {shift: 2});
        });
    }
</script>
</html>